<template>
	<view class="contain">
		<uni-list style="margin-top: 20px;">
			<uni-list-item title="用户余额" >
				<template v-slot:footer>
					<view>{{userinfo.consumeBalance}}</view>
				</template>
			</uni-list-item>
			<uni-list-item clickable @click="tiao" title="在线充值" showArrow></uni-list-item>
			<uni-group title="充值列表">
				<uni-table stripe emptyText="暂无更多数据">
					<uni-tr>
						<uni-th align="center">充值时间</uni-th>
						<uni-th align="center">订单号</uni-th>
						<uni-th align="center">充值金额</uni-th>
					</uni-tr>
					<uni-tr :key="index" v-for="(item,index) in userlist">
						<uni-td>{{item.orderTime}}</uni-td>
						<uni-td>{{item.orderNumber}}</uni-td>
						<uni-td>{{item.rechargeAmount}}</uni-td>
					</uni-tr>
				</uni-table>
			</uni-group>
			
			
		</uni-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo:{},
				userlist:{}
			}
		},
		onLoad() {
			this.getinfo()
			this.getadduser()
		},
		methods: {
			tiao(){
				uni.navigateTo({
					url:"/pages/payment/payment"
				})
			},
			async getadduser(){
				const res =await this.$request.getrechargelist()
				this.userlist=res.data.rows
				this.userlist=this.userlist.filter(item=>{return item.userId=='1083'})
			},
			async getinfo(){
				const res =await this.$request.getInfo()
				console.log(res)
				this.userinfo=res.data.user
			},
			
		}
	}
</script>

<style>

</style>
